package com.winning.pmph.config;

import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 资源服务器配置
 * @author lbm
 *
 */
@Configuration
@ConfigurationProperties()
public class ResourceServerConfig {

	/**
	 * 静态文件地址
	 */
	public static String staticFileUrl;

	/**
	 * 服务器接口地址
	 */
	public static String domain = "http://192.168.107.209:5700/";

	public static String clientId = "5905849707055105";

	public static String clientKey = "fb77f3bd6fe2b731500aaa3bbc082407b5f92abc";
	
	public static RequestConfig reqConfig = RequestConfig.custom().setConnectTimeout(10 * 1000).build();
	
	public static RequestConfig uploadConfig = RequestConfig.custom().setConnectTimeout(60 * 60 * 1000).build();
	
	public static CloseableHttpClient httpClient = HttpClients.createDefault();

	@Value("${resource-server.static-file-url}")
	public void setStaticFileUrl(String path) {
		staticFileUrl = path;
	}

	@Value("${resource-server.domain}")
	public void setDomain(String path) {
		domain = path;
	}

	@Value("${resource-server.clientId}")
	public void setClientId(String path) {
		clientId = path;
	}

	@Value("${resource-server.clientKey}")
	public void setClientKey(String path) {
		clientKey = path;
	}

}
